cmake_minimum_required(VERSION 3.10.2)
project(data_object)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-std=c++1y -fno-rtti -fvisibility=default -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../mock)
set(KV_STORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../kv_store)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/src data_object_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/src/adaptor data_object_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/src/communicator data_object_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/src data_object_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/jskitsimpl/src/adaptor data_object_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/jskitsimpl/src/common data_object_src)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/include/adaptor)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/include/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/include/communicator)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/innerkitsimpl/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/jskitsimpl/include/adaptor )
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/jskitsimpl/include/common )
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/innerkits)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../datamgr_service/services/distributeddataservice/adapter/include/dfx)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/safwk/native/include)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)
include(${KV_STORE_DIR}/interfaces/CMakeLists.txt OPTIONAL)

set(links secure mock adapter distributeddb kvdb)
add_library(data_object SHARED ${data_object_src})
target_link_libraries(data_object ${links})